﻿<UserControl x:Class="GestaltDesigner.PropertyGrid"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"
    xmlns:local="clr-namespace:GestaltDesigner"         
             xmlns:vsm="clr-namespace:System.Windows;assembly=System.Windows"         
             >
    <UserControl.Resources>
        <local:ImageSourceToStringConverter x:Key="converterImage"/>
        <local:DeepZoomImageTileSourceToStringConverter x:Key="converterDeepZoom"/>
        <local:UriToStringConverter x:Key="converterMediaElement"/>
    	<Style x:Key="TextBoxStyle1" TargetType="TextBox">
    		<Setter Property="BorderThickness" Value="1"/>
    		<Setter Property="Background" Value="#FFFFFFFF"/>
    		<Setter Property="Foreground" Value="#FFC2C2C2"/>
    		<Setter Property="Padding" Value="2"/>
    		<Setter Property="BorderBrush">
    			<Setter.Value>
    				<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
    					<GradientStop Color="#FFA3AEB9" Offset="0"/>
    					<GradientStop Color="#FF8399A9" Offset="0.375"/>
    					<GradientStop Color="#FF718597" Offset="0.375"/>
    					<GradientStop Color="#FF617584" Offset="1"/>
    				</LinearGradientBrush>
    			</Setter.Value>
    		</Setter>
    		<Setter Property="Template">
    			<Setter.Value>
    				<ControlTemplate TargetType="TextBox">
    					<Grid x:Name="RootElement">
    						<vsm:VisualStateManager.VisualStateGroups>
    							<vsm:VisualStateGroup x:Name="CommonStates">
    								<vsm:VisualState x:Name="Normal"/>
    								<vsm:VisualState x:Name="MouseOver">
    									<Storyboard>
    										<ColorAnimationUsingKeyFrames Storyboard.TargetName="MouseOverBorder" Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)">
    											<SplineColorKeyFrame KeyTime="0" Value="#FFC2C2C2"/>
    										</ColorAnimationUsingKeyFrames>
    									</Storyboard>
    								</vsm:VisualState>
    								<vsm:VisualState x:Name="Disabled">
    									<Storyboard>
    										<DoubleAnimationUsingKeyFrames Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="Opacity">
    											<SplineDoubleKeyFrame KeyTime="0" Value="1"/>
    										</DoubleAnimationUsingKeyFrames>
    									</Storyboard>
    								</vsm:VisualState>
    								<vsm:VisualState x:Name="ReadOnly">
    									<Storyboard>
    										<DoubleAnimationUsingKeyFrames Storyboard.TargetName="ReadOnlyVisualElement" Storyboard.TargetProperty="Opacity">
    											<SplineDoubleKeyFrame KeyTime="0" Value="1"/>
    										</DoubleAnimationUsingKeyFrames>
    									</Storyboard>
    								</vsm:VisualState>
    							</vsm:VisualStateGroup>
    							<vsm:VisualStateGroup x:Name="FocusStates">
    								<vsm:VisualState x:Name="Focused">
    									<Storyboard>
    										<DoubleAnimationUsingKeyFrames Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Opacity">
    											<SplineDoubleKeyFrame KeyTime="0" Value="1"/>
    										</DoubleAnimationUsingKeyFrames>
    									</Storyboard>
    								</vsm:VisualState>
    								<vsm:VisualState x:Name="Unfocused">
    									<Storyboard>
    										<DoubleAnimationUsingKeyFrames Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Opacity">
    											<SplineDoubleKeyFrame KeyTime="0" Value="0"/>
    										</DoubleAnimationUsingKeyFrames>
    									</Storyboard>
    								</vsm:VisualState>
    							</vsm:VisualStateGroup>
    						</vsm:VisualStateManager.VisualStateGroups>
    						<Border x:Name="Border" Opacity="1" Background="#727E7E7E" BorderBrush="Black" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="5,5,5,5">
    							<Grid>
    								<Border x:Name="ReadOnlyVisualElement" Opacity="0" Background="#72F7F7F7"  CornerRadius="5,5,5,5"/>
    								<Border x:Name="MouseOverBorder" BorderBrush="Transparent" BorderThickness="1"  CornerRadius="5,5,5,5">
    									<ScrollViewer x:Name="ContentElement" BorderThickness="0" IsTabStop="False" Padding="{TemplateBinding Padding}"/>
    								</Border>
    							</Grid>
    						</Border>
    						<Border x:Name="DisabledVisualElement" IsHitTestVisible="False" Opacity="0" Background="#A5F7F7F7" BorderBrush="#A5F7F7F7" CornerRadius="5,5,5,5" BorderThickness="{TemplateBinding BorderThickness}"/>
    						<Border Margin="1" x:Name="FocusVisualElement" IsHitTestVisible="False" Opacity="0" BorderBrush="#FFC2C2C2"  CornerRadius="5,5,5,5" BorderThickness="{TemplateBinding BorderThickness}"/>
    					</Grid>
    				</ControlTemplate>
    			</Setter.Value>
    		</Setter>
    	</Style>
    </UserControl.Resources>
    <Grid x:Name="LayoutRoot" Width="Auto" Background="#FF333333">
        <Grid Width="Auto" HorizontalAlignment="Stretch" VerticalAlignment="Top" >

        	<Grid.RowDefinitions>
        		<RowDefinition Height="0.625*"/>
        		<RowDefinition Height="0.375*"/>
        	</Grid.RowDefinitions>
            <TextBlock Canvas.Left="6" Canvas.Top="5" Foreground="#FFC2C2C2" Text="Properties" TextWrapping="Wrap" FontFamily="Tahoma" FontSize="11" Margin="3,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Center"/>
            <StackPanel x:Name="stackPanelPropertyGrid" Visibility="Collapsed" Grid.RowSpan="1" Grid.Row="1" Margin="10,10,10,10">
            	<StackPanel Orientation="Horizontal" HorizontalAlignment="Stretch" Margin="0,2,2,0">
            		<TextBlock Foreground="#FFC2C2C2"  TextWrapping="Wrap" FontFamily="Tahoma" FontSize="11" Text="Name:" HorizontalAlignment="Stretch" VerticalAlignment="Center" Width="55"/>
            		<TextBox Width="200" x:Name="NameTextBox" Text="{Binding Mode=TwoWay, Path=Name}" Height="24" HorizontalAlignment="Stretch" Style="{StaticResource TextBoxStyle1}"/>
            	</StackPanel>
            	<StackPanel Orientation="Horizontal" HorizontalAlignment="Stretch" Margin="0,2,2,0">
            		<TextBlock Foreground="#FFC2C2C2"  TextWrapping="Wrap" FontFamily="Tahoma" FontSize="11" Text="Width:" HorizontalAlignment="Stretch" VerticalAlignment="Center" Width="55"/>
            		<TextBox  Style="{StaticResource TextBoxStyle1}" Width="200" x:Name="WidthTextBox" Text="{Binding Mode=TwoWay, Path=Width}" Height="24" HorizontalAlignment="Right"/>
            	</StackPanel>
            	<StackPanel Orientation="Horizontal" HorizontalAlignment="Stretch" Margin="0,2,2,0">
            		<TextBlock Foreground="#FFC2C2C2"  TextWrapping="Wrap" FontFamily="Tahoma" FontSize="11" Text="Height:" HorizontalAlignment="Stretch" VerticalAlignment="Center" Width="55"/>
            		<TextBox Style="{StaticResource TextBoxStyle1}" Width="200" x:Name="HeightTextBox" Text="{Binding Mode=TwoWay, Path=Height}" Height="24" HorizontalAlignment="Right"/>
            	</StackPanel>

                <StackPanel Orientation="Horizontal" HorizontalAlignment="Stretch" Margin="0,2,2,0">
                    <TextBlock Foreground="#FFC2C2C2"  TextWrapping="Wrap" FontFamily="Tahoma" FontSize="11" Text="Top:" HorizontalAlignment="Stretch" VerticalAlignment="Center" Width="55"/>
                    <TextBox Style="{StaticResource TextBoxStyle1}" Width="200" x:Name="TopTextBox" Text="{Binding Mode=TwoWay, Path=Top}" Height="24" HorizontalAlignment="Right"/>
                </StackPanel>
                <StackPanel Orientation="Horizontal" HorizontalAlignment="Stretch" Margin="0,2,2,0">
                    <TextBlock Foreground="#FFC2C2C2"  TextWrapping="Wrap" FontFamily="Tahoma" FontSize="11" Text="Left:" HorizontalAlignment="Stretch" VerticalAlignment="Center" Width="55"/>
                    <TextBox Style="{StaticResource TextBoxStyle1}" Width="200" x:Name="LeftTextBox" Text="{Binding Mode=TwoWay, Path=Left}" Height="24" HorizontalAlignment="Right"/>
                </StackPanel>



                <StackPanel Orientation="Horizontal" HorizontalAlignment="Stretch" Margin="0,2,2,0">
            		<TextBlock Foreground="#FFC2C2C2"  TextWrapping="Wrap" FontFamily="Tahoma" FontSize="11" ToolTipService.ToolTip="Value must be between 0 and 1." Text="Opacity:" HorizontalAlignment="Stretch" VerticalAlignment="Center" Width="55"/>
            		<TextBox Style="{StaticResource TextBoxStyle1}" Width="200" x:Name="OpacityTextBox" Text="{Binding Mode=TwoWay, Path=Opacity}" Height="24" HorizontalAlignment="Right"/>
            	</StackPanel>
                <StackPanel x:Name="stackPanelContent" Orientation="Horizontal" HorizontalAlignment="Stretch" Margin="0,2,2,0">
                    <TextBlock Foreground="#FFC2C2C2"  TextWrapping="Wrap" FontFamily="Tahoma" FontSize="11" Text="Content:" HorizontalAlignment="Stretch" VerticalAlignment="Center" Width="55"/>
                    <TextBox Style="{StaticResource TextBoxStyle1}" Width="200" x:Name="ContentTextBox" Text="{Binding Mode=TwoWay, Path=Content}" Height="24" HorizontalAlignment="Right"/>
                </StackPanel>
                <StackPanel x:Name="stackPanelText" Orientation="Horizontal" HorizontalAlignment="Stretch" Margin="0,2,2,0">
                    <TextBlock Foreground="#FFC2C2C2"  TextWrapping="Wrap" FontFamily="Tahoma" FontSize="11" Text="Text:" HorizontalAlignment="Stretch" VerticalAlignment="Center" Width="55"/>
                    <TextBox Style="{StaticResource TextBoxStyle1}" Width="200" x:Name="TextTextBox" Text="{Binding Mode=TwoWay, Path=Text}" Height="24" HorizontalAlignment="Right"/>
                </StackPanel>
                <StackPanel x:Name="stackPanelImage" Orientation="Horizontal" HorizontalAlignment="Stretch" Margin="0,2,2,0">
                    <TextBlock Foreground="#FFC2C2C2"  TextWrapping="Wrap" FontFamily="Tahoma" FontSize="11" Text="Source:" HorizontalAlignment="Stretch" VerticalAlignment="Center" Width="55"/>
                    <TextBox Style="{StaticResource TextBoxStyle1}" Width="200" x:Name="SrcTextBox" Text="{Binding Converter={StaticResource converterImage}, Mode=TwoWay, Path=Src}" Height="24" HorizontalAlignment="Right"/>
                </StackPanel>

                <StackPanel x:Name="stackPanelDeepZoom" Orientation="Horizontal" HorizontalAlignment="Stretch" Margin="0,2,2,0">
                    <TextBlock Foreground="#FFC2C2C2"  TextWrapping="Wrap" FontFamily="Tahoma" FontSize="11" Text="Source:" HorizontalAlignment="Stretch" VerticalAlignment="Center" Width="55"/>
                    <TextBox Style="{StaticResource TextBoxStyle1}" Width="200" x:Name="DeepZoomSrcTextBox" Text="{Binding Converter={StaticResource converterDeepZoom}, Mode=TwoWay, Path=DeepzoomSrc}" Height="24" HorizontalAlignment="Right"/>
                </StackPanel>


                <StackPanel x:Name="stackPanelMedia">
                    <StackPanel Orientation="Horizontal" HorizontalAlignment="Stretch" Margin="0,2,2,0">
                        <TextBlock Foreground="#FFC2C2C2"  TextWrapping="Wrap" FontFamily="Tahoma" FontSize="11" Text="Source:" HorizontalAlignment="Stretch" VerticalAlignment="Center" Width="55"/>
                        <TextBox Style="{StaticResource TextBoxStyle1}" Width="200" x:Name="MediaSrcTextBox" Text="{Binding Converter={StaticResource converterMediaElement}, Mode=TwoWay, Path=MediaSrc}" Height="24" HorizontalAlignment="Right"/>
                    </StackPanel>
                    <StackPanel Orientation="Horizontal" HorizontalAlignment="Stretch" Margin="0,2,2,0">
                        <TextBlock Foreground="#FFC2C2C2"  TextWrapping="Wrap" FontFamily="Tahoma" FontSize="11" Text="Autoplay:" HorizontalAlignment="Stretch" VerticalAlignment="Center" Width="55"/>
                        <TextBox Style="{StaticResource TextBoxStyle1}" Width="200" x:Name="AutoPlayTextBox" Text="{Binding Mode=TwoWay, Path=AutoPlay}" Height="24" HorizontalAlignment="Right"/>
                    </StackPanel>
                </StackPanel>
            </StackPanel>
        </Grid>

        <Grid Margin="0,19,0,0" VerticalAlignment="Stretch" d:IsHidden="True">
            <Rectangle Stretch="Fill" Stroke="#FF595959" StrokeThickness="3" x:Name="borderRect" RadiusX="5" RadiusY="5" />
        </Grid>
    </Grid>
</UserControl>
